package cn.dotalk.usermanage.learn;

import cn.dotalk.usermanage.entity.PersonEntity;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.w3c.dom.stylesheets.LinkStyle;

import java.util.Date;
import java.util.List;

@Slf4j
public class Do {
    public static void main(String[] args) {

        System.out.println("T");
        log.info("dddd");
        log.info(JSON.toJSONString(new PersonEntity(1, "安徽")));
        System.out.println(System.nanoTime());
        if (3 == 3 && (4 == 4)) {
            log.info("if");
        }

        Boolean b = false;
        System.out.println(b);

        String b1 = "ddd";
        System.out.println(b1);

        // Integer b2 = 2;
        int b2 = 2;
        System.out.println(b2);

        //单精度
        float b3 = 4.501000000333f;
        System.out.println(b3);
        // 4.501

        double b4 = 4.501000000333d;
        System.out.println(b4);

        char b5 = 'A';
        System.out.println(b5);

        short b6 = 'A';
        System.out.println(b6);

        byte b7 = 'A';
        System.out.println(b7);


        //定义int 类型数组
        int[] sortNum = {12, 33, 28, 86, 15, 62, 9, 38};
        System.out.println(sortNum);
        System.out.println(sortNum.length);

        //GC
        System.gc();


        int i = 10;
        while (i < 20) {
            i++;
            System.out.println("变量：" + i);
        }

        for (int j = 0; j < 10; j++) {
            System.out.println("变量-for：" + j);
        }


        //定义int array
        int[] number = {10, 32, 44};
        for (int x :
                number) {
            System.out.println("int array for: " + x);
        }

        //定义字符串数组
        String[] s1 = {"L", "hi"};
        for (String x :
                s1) {
            System.out.println("string array for: " + x);
        }

        // break 测试
        int[] n1 = {1, 10, 16, 89};
        for (int x : n1) {
            if (x == 16) break;
            System.out.println("break for: " + x);
        }

        // continue 测试
        int[] n2 = {1, 10, 16, 89};
        for (int x : n2) {
            if (x == 16) continue;
            System.out.println("continue for: " + x);
        }

        // double[] m;
        // double n[];
        // System.out.println(m.toString());
        // System.out.println(n.toString());

        double[] myList = new double[3];
        double[] myList2 = {3.4, 56, 89};
        System.out.println(myList);
        System.out.println(myList2);

        String str[][] = new String[5][6];
        System.out.println(str);

        System.out.println((new Date()).toString());
        System.out.println(new Date());
        System.out.println(new Date().toString());
    }
}
